package com.ep.commonbaseadapter.base;

import android.content.Context;

/**
 * Created by Administrator on 2017/7/31.
 */

public abstract class SingleItemTypeBaseAdapter<T> extends MultiItemTypeBaseAdapter<T> {
    public SingleItemTypeBaseAdapter(Context context, final int layoutId) {
        super(context);
        addItemViewDelegate(new ItemViewDelegate<T>() {
            @Override
            public int getItemViewLayoutId() {
                return layoutId;
            }

            @Override
            public boolean isForViewType(T data, int postiton) {
                return true;
            }

            @Override
            public void bindData(ViewHolder viewHolder, T data, int position) {
                SingleItemTypeBaseAdapter.this.bindData(viewHolder,data,position);
            }
        });
    }
    protected abstract void bindData(ViewHolder viewHolder, T data, int position);
}
